﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameUtils.Input
{
    public sealed class CharacterEventArgs : EventArgs
    {
        #region Properties
        public char Character { get; private set; }

        public int RepeatCount
        {
            get { return mLParam & 0xffff; }
        }

        public bool ExtendedKey
        {
            get { return (mLParam & (1 << 24)) > 0; }
        }

        public bool AltPressed
        {
            get { return (mLParam & (1 << 29)) > 0; }
        }

        public bool PreviousState
        {
            get { return (mLParam & (1 << 30)) > 0; }
        }

        public bool TransitionState
        {
            get { return (mLParam & (1 << 31)) > 0; }
        }

        private int mLParam;
        #endregion

        #region Constructors
        public CharacterEventArgs(
            char pCharacter,
            int pLParam)
        {
            Character = pCharacter;
            mLParam = pLParam;
        }
        #endregion
    }
}